PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Control Manager >

Programming With the Mac OS 8.5 Control Manager


Control Definition Message Constants

The Mac OS 8.5 Control Manager may pass the following new constants in the message parameter of your control definition function to specify the actions that your function must perform. For other control definition message constants, see "Defining Your Own Control Definition Function" in Mac OS 8 Control Manager Reference .

enum {
    kControlMsgApplyTextColor   = 30,
    kControlMsgGetRegion        = 31
};

Constant descriptions

kControlMsgApplyTextColor
Set the foreground color to be consistent with the current drawing environment and suitable for display against the background color or pattern. To indicate that your control definition function supports this message, set the kControlHasSpecialBackground feature bit. When this message is sent, the Control Manager passes a pointer to a structure of type ControlApplyTextColorRec in your control definition function's param parameter. The Control Manager sets the ControlApplyTextColorRec structure to contain data describing the current drawing environment. Your control definition function is responsible for using this data to apply a text color which is consistent with the current theme and optimally readable on the control's background. Your control definition function should return 0 as the function result.
kControlMsgGetRegion
Obtain the region occupied by the specified control part. To indicate that your control definition function supports this message, set the kControlSupportsGetRegion feature bit. When this message is sent, the Control Manager passes a pointer to a structure of type ControlGetRegionRec in your control definition function's param parameter. Your control definition function is responsible for setting the region field of the ControlGetRegionRec structure to the region that contains the control part which the Control Manager specifies in the part field. Your control definition function return a result code of type OSStatus as the function result.

© 1999 Apple Computer, Inc. — (Last Updated 20 Jan 99)